<template>
	<view class="container">
		<view class="header">
			<text class="title">系统设置</text>
		</view>

		<view class="settings-list">
			<view class="setting-item" v-for="(setting, index) in settings" :key="index">
				<view class="setting-name">{{ setting.name }}</view>
				<view class="setting-toggle">
					<switch :checked="setting.checked" @change="handleSwitchChange(index)"></switch>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				settings: [{
						name: '接收通知',
						checked: true
					},
					{
						name: '自动更新',
						checked: false
					},
					{
						name: '隐私设置',
						checked: true
					}
				]
			};
		},
		methods: {
			handleSwitchChange(index) {
				this.settings[index].checked = !this.settings[index].checked;
			}
		}
	};
</script>

<style>
	.container {
		background: #f5f7fa;
		padding: 20rpx;
	}

	.header {
		background: #003b90;
		color: #fff;
		padding: 40rpx 30rpx;
	}

	.title {
		font-size: 36rpx;
		font-weight: bold;
	}

	.settings-list {
		margin-top: 20rpx;
		background: #fff;
	}

	.setting-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30rpx;
		border-bottom: 1px solid #f0f0f0;
	}

	.setting-name {
		font-size: 30rpx;
		color: #333;
	}

	.setting-toggle {
		display: flex;
		align-items: center;
	}
</style>